#!/usr/bin/env python
#-*-coding:utf-8-*-

import requests
import json


def lexical_api():
    headers = {"Content-Type":"application/json"}
    url = "http://localhost:5556/nlp/lexical"
    data = {
        "text": "我在北京看埃菲尔铁塔，你在非洲看雪，工作不好找，上BOSS直聘吧,你会写Java吗,人工智能很厉害需要很多人工",
        "tag": 1,
        "ner": 1,
        "dict": "",
    }
    print(json.dumps(data, ensure_ascii=False, indent=4))
    res = requests.post(url, data = json.dumps(data), headers = headers, timeout=10)
    print(json.dumps(res.json(), ensure_ascii=False, indent=4))
    print(res.json())


if __name__ == '__main__':
    lexical_api()
